﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SLNGP.Common.IoC;
using SLNGP.Core.Fitness;
using SLNGP.Core.Genes;
using SLNGP.Core.GeneticPrograms;
using SLNGP.Core.Individuals;
using SLNGP.Core.Run;
using SLNGP.Core.StopRun;

namespace SLNGP.Core
{
    public static class Initializer
    {
        public static void InitializeIoC()
        {
            IoC.Register<IGeneration, Generation>();
            IoC.Register<IIndividual, Individual>();
            IoC.Register<IChromosome, Chromosome>();
            IoC.Register<IGene, Gene>();
            IoC.Register<IGeneticProgram, GeneticProgram>();
            IoC.Register<IGeneticProgrammingRun, GeneticProgrammingRun>();
            IoC.Register<IGeneticProgrammingRunResults, GeneticProgrammingRunResults>();
            IoC.Register<IStopRunConditions, StopRunConditions>();
            IoC.Register(typeof(ISingleFitnessFunction<>), typeof(SingleIndivdualFitnessFunction<>));
        }

        public static void Initialize()
        {
            if (!IsTesting)
                InitializeIoC();
        }

        public static bool IsTesting { get; set; }
    }
}
